<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.wxisme.ssm.po.Album" %>
<%@page import="com.wxisme.ssm.po.Photo" %>
<%@page import="com.wxisme.ssm.po.UserInfo" %>
<%@page import="java.math.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
	<meta name="author" content="Luka Cvrk - www.solucija.com" />
	<meta name="description" content="Site Description" />
	<meta name="keywords" content="site, keywords" />
	<meta name="robots" content="index, follow" />
	<link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="css/side.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="css/button.css" />
	<title>welcome</title>
	
    <%
	String username = (String)session.getAttribute("username");
	if(username == null) {
		response.sendRedirect(basePath + "login.jsp");
	}
	%>
	
	<%
	   
		//获取UserInfo
		UserInfo userInfo = (UserInfo) request.getAttribute("friendInfo");
		
		Date date = new Date(userInfo.getRegisterTime());
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		String time = sdf.format(date);
		
		
	
	 %>

	<script src="${pageContext.request.contextPath}/js/check.js" type="text/javascript"></script>
  </head>
  
  <body>
  
	<div class="backwhite">
	<div class="header">
		<div id="search">
			<form action="">
				<fieldset>
					<input type="text" class="field" value="" placeholder="搜索"/>
					<input type="submit" class="buttons" value="" />
				</fieldset>
			</form>
		</div>
		<ul id="menu">
			<li><a href="welcome.jsp">首页</a></li>
			<!-- <li><a href="login.jsp">登录</a></li> -->
			<!-- <li><a href="register.jsp">注册</a></li> -->
			<li><a href="about.jsp">关于</a></li>
			<li><a href="photowall.jsp">照片墙</a></li>
			<li><a class="current" href="#">个人中心</a></li>
			<li>
			<form action="${pageContext.request.contextPath}/logout.action" method="post">
			<div class="logout">
			<input class="inputbutton" type="submit" name="submitlogout" value="退出/切换"/>
		    </div>
			</form>
			
			</li>
		</ul>
	</div>


  		<div class="main">
  		
  		
  			<br />
			<br />
			<div class="noNextLine">
			
			<form onsubmit="return confirmDel();" action="${pageContext.request.contextPath}/deleteFriend.action" method="post">
			<input style="float:right;margin-right:1080px"; class="button button-pill button-primary" type="submit" name="submit" value="移除该朋友" />
			
			</form>
			
			<a href="displayFriendAlbums.jsp" class="button button-pill button-primary">返回</a>
			
			
			
			
			</div>
			
			<br/><br/>
			
			<center>
			<table style="font-size:20px;font-family:Microsoft YaHei;table-layout: fixed"; border="0" cellspacing="0" cellpadding="0" >
				<tr height="35px">
					<td width="120px">用户名：</td>
					<td ><%=userInfo.getUsername() %></td>
				</tr>
				<tr height="35px">
					<td>姓名：</td>
					<td><%=userInfo.getRealName()==null ?  "" : userInfo.getRealName()%></td>
				</tr>
				<tr height="35px">
					<td>年龄：</td>
					<td><%=userInfo.getAge()==null ?  "" : userInfo.getAge()%></td>
				</tr>
				<tr height="35px">
					<td>性别：</td>
					<td><%=userInfo.getSex()==null ? "" : userInfo.getSex() %></td>
				</tr>
				<tr height="35px">
					<td>所在地：</td>
					<td><%=userInfo.getAddress()==null ? "" : userInfo.getAddress() %></td>
				</tr>
				<tr height="35px">
					<td>电话：</td>
					<td><%=userInfo.getTel()==null ? "" : userInfo.getTel() %></td>
				</tr>
				<tr height="35px">
					<td>邮箱：</td>
					<td><%=userInfo.getEmail()==null ? "" : userInfo.getEmail() %></td>
				</tr>
				<tr height="35px">
					<td>QQ：</td>
					<td><%=userInfo.getQq()==null ? "" : userInfo.getQq() %></td>
				</tr>
				<tr height="35px">
					<td>相册数：</td>
					<td><%=userInfo.getAlbumNumber() %></td>
				</tr>
				<tr height="35px">
					<td>照片数：</td>
					<td><%=userInfo.getPhotoNumber() %></td>
				</tr>
				<tr height="35px">
					<td>注册时间：</td>
					<td><%=time %></td>
				</tr>
				<tr height="35px">
					<td>个人说明：</td>
					<td width="400px"><%=userInfo.getPersonalsay()==null ? "" : userInfo.getPersonalsay() %></td>
				</tr>
				
			</table>
			</center>
			
			
		
  		</div>
		
	</div>
	

	<div id="promo">
		<div class="wrap">
		<!--
			<div class="col">
				<img id="featured" src="images/featured.gif" alt="Featured Image" />
			</div>
	     -->
			
			<div id="footer">
				 <p><a href="#" target="_blank">关于</a>|免责声明：部分素材来自互联网，如有侵权请告知。|欢迎交流：850885154@qq.com</p>
				<p>Copyright &copy; 2015 &minus; 王旭 &minus; Design: &minus; <a href="http://www.cnblogs.com/wxisme/" target="_blank">wxisme</a></p>
			</div>
		</div>
	</div>
	
</body>
</html>
